<template>
    <p>Home</p>
    <h1>js跳转</h1>
    <button @click="pushStr">push-字符串-跳转</button>
    <button @click="pushPath">push-路径-跳转</button>
    <button @click="pushName">push-名字-跳转</button>
</template>

<script setup>
import {useRouter} from 'vue-router'

const router = useRouter()

const pushStr = ()=>{
    router.push('/about')
}

const pushPath = ()=>{
    router.push({path:'/about'})
}

const pushName = ()=>{
    router.push({name:'about'})
}

</script>